﻿<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<List<JobDescOnline.Presentation.Models.JobDescResponsibilityModel>>" %>

<% foreach (var res in Model) { %>
    <tr valign="top">
        <td>
            <%= Html.Hidden("JobDescriptionID" + res.ID.ToString(), res.JobDescriptionID)%>
            <%= Html.TextBox("MainTask" + res.ID.ToString(), res.MainTask)%>
        </td>
        <td><%= Html.TextArea("Activities" + res.ID.ToString(), res.Activities)%></td>
        <td>
            <input type="button" onclick="return SaveResponsibility(<%= res.ID.ToString() %>);" value="Save" />
            <input type="button" onclick="return DeleteResponsibility(<%= res.ID.ToString() %>);" value="Delete" />
        </td>
    </tr>
    <tr>
        <td></td>
        <td>
            PI:<br />
            <div id="PIBody<%= res.ID.ToString() %>">
                <% foreach (var pi in res.PI) { %>
                    &nbsp;&nbsp;&nbsp;<%= Html.TextBox("PI" + pi.ID.ToString(), pi.PI, new { @style = "width: 320px" })%>
                    <input type="button" value="Simpan" onclick="return SavePI(<%= pi.ID.ToString() %>, <%= res.ID.ToString() %>);" />
                    <input type="button" value="Hapus" onclick="return DeletePI(<%= pi.ID.ToString() %>, <%= res.ID.ToString() %>);" /><br /><br />
                <% } %>
            </div>
            &nbsp;&nbsp;&nbsp;<%= Html.TextBox("PIS" + res.ID.ToString(), "", new { @style = "width: 400px" })%>
            <input type="button" value="Tambah" onclick="return InsertPI(<%= res.ID.ToString() %>);" />
        </td>
        <td></td>
    </tr>
<% } %>